<template>
  <div class="header">
    <h1>小黑记事本</h1>
    <input type="text" v-model="name">
    <button @click="add">添加任务</button>
  </div>
  
</template>
<script>
export default{
    name:'',
    data () {
        return {
          name:''
            
        }
    },
    created () {
    },
    computed:{
    },
    methods:{
      add(){
        this.$emit('addE', {id:Date.now(),name:this.name });
        this.name=''
      }
    }
}
</script>
<style lang='less'  scoped>
    .header{
      background-color: pink;
    }
</style>
